<?
header('Content-Type:application/json;charset=UTF-8');
include("../../com/website_config.php");

$detail_id=$_GET['detail_id'];
$id=(int)$detail_id;




$data=array();
$i=0;
//如果不是数字
if($id===0){
    $detail_id=urldecode($detail_id);
    $sql="select * from car_nav where car_brand='$detail_id'";
    $result=$db->query($sql);
    $rw=mysql_num_rows($result);
    if($rw==""){
        echo "暂时还没有信息!";
    }else{
//            $array[0]=mysql_fetch_array($result);
        while($array=mysql_fetch_array($result)){
            $desc='<p><strong>品牌分类：</strong>'.$array["car_brand"].'</p><p style="white-space: normal;"></p><p><strong>报价请电联：</strong>18120116637</p><p style="white-space: normal;"></p><p><strong>座位险:</strong>50 万元</p><p><strong>座位数:</strong>53+2 座（含司机及导游副座位）</p><p><strong>车况等级：</strong><img src="http://www.ashlybus.com/ueditor/php/upload/image/20161110/1478718306850193.jpg" alt="1478718306850193.jpg"><img src="http://www.ashlybus.com/ueditor/php/upload/image/20161110/1478718306850193.jpg" alt="1478718306850193.jpg"><img src="http://www.ashlybus.com/ueditor/php/upload/image/20161110/1478718306850193.jpg" alt="1478718306850193.jpg"><img src="http://www.ashlybus.com/ueditor/php/upload/image/20161110/1478718306850193.jpg" alt="1478718306850193.jpg"><img src="http://www.ashlybus.com/ueditor/php/upload/image/20161110/1478718306850193.jpg" alt="1478718306850193.jpg"></p><p style="white-space: normal;"></p><p><strong>车型特点：</strong>外观飘逸，动力充足，空间大，噪音小，坐感舒适，安全性高，适合婚车用车</p>';
            $data[0]=array(
                         'pro_title' => '婚车',
                         'pro_content' => $desc
                         );;
//     ../../images/hc/695993644392979401.jpg

            $data['img'][$i]="../img/hc/".$array["car_img"];
            $i++;
        }
    }
}else{
    $sql="select * from ms_product where pro_id=$detail_id";
    $photoSQL="select * from ms_product_photo where pro_id=$detail_id";

    $result=$db->query($sql);
    $photo=$db->query($photoSQL);
    $rw=mysql_num_rows($photo);

    if($rw==""){
        echo "暂时还没有信息!";
    }else{
        $data[0]=mysql_fetch_array($result);
        while($p=mysql_fetch_array($photo)){
    // ../../uploads/1482475814_1719358199.jpg
    //更改为../img/uploads/1481765545_730827999.jpg
            $data['img'][$i]="../img".substr($p["img_path"],5);
            $i++;
        }
    }
}



echo json_encode($data);


?>
